﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GroupManager.Resource.CSDL;
namespace GroupManager.Class
{
    public class LopNhiemKy
    {
        // Thêm nhiệm kỳ;
        public static void ThemNhiemKy(string ten)
        {
            dbGroupManagerDataContext db = new dbGroupManagerDataContext();
            NhiemKy nhk = new NhiemKy();
            nhk.NhiemKy1 = ten;
            db.NhiemKies.InsertOnSubmit(nhk);
            db.SubmitChanges();
        }

        // Sửa nhiệm kỳ;

        // Xóa nhiệm kỳ;
        public static void XoaNhiemKy(string ten)
        {
            dbGroupManagerDataContext db = new dbGroupManagerDataContext();
            NhiemKy nhk = db.NhiemKies.SingleOrDefault(q => q.NhiemKy1 == ten);
            db.NhiemKies.DeleteOnSubmit(nhk);
            db.SubmitChanges();
        }
    }
}